home *** CD-ROM | disk | FTP | other *** search
/ Macworld Expo - Develope…Central & Net Innovations / Developer Central and Net Innovators (MacWorld Expo) (January 1999).iso / Developer Central / Bowers Development / Demo AppMaker / Examples / Pascal OS8 / AMReminder / AMReminderApp.p < prev    next >
Encoding:
Text File  |  1998-10-30  |  1.5 KB  |  112 lines  |  [TEXT/CWIE]

  1. { AMReminderApp.p -- application-level functions }
  2. { Created 10/30/98 1:03 PM by AppMaker }
  3.  
  4. Unit AMReminderApp;
  5. Interface
  6.  
  7. Uses
  8.     Types,
  9.     Quickdraw,
  10.     Controls,
  11.     Events,
  12.     Files,
  13.     Lists,
  14.     Menus,
  15.     TextEdit,
  16.     AMDoc,
  17.     AMApp;
  18.  
  19. type
  20.     AMReminderApp        = object (AMApp)
  21.  
  22.     {data members}
  23.  
  24.     {methods - public}
  25.         Procedure Initialize; Override;
  26.         Procedure OpenApp; Override;
  27.  
  28.         Function  DoCommand        (inCommand:    longint): Boolean; Override;
  29.  
  30.     {methods - internal}
  31.         Function  MakeDoc: AMDoc; Override;
  32.  
  33.     end;
  34.  
  35. {----------}
  36. Function NewAMReminderApp: AMReminderApp;
  37.  
  38. {----------}
  39. Implementation
  40.  
  41. Uses
  42.     ResourceDefs,
  43.  
  44.     AMReminderEngine,
  45.     AMReminderDoc,
  46.     AMWindow;
  47.  
  48. {----------}
  49. Function NewAMReminderApp: AMReminderApp;
  50. var
  51.     app:        AMReminderApp;
  52. begin
  53.     New (app);
  54.     if app <> nil then begin
  55.         app.Initialize;
  56.     end;
  57.     NewAMReminderApp := app;
  58. end;
  59.  
  60. {----------}
  61. Procedure AMReminderApp.Initialize;
  62. Begin
  63.     inherited Initialize;
  64.  
  65.     mNumOpenTypes := 1;
  66.     mOpenTypeList [0] := kFileType;
  67. End;
  68.  
  69. {----------}
  70. Function AMReminderApp.MakeDoc: AMDoc;
  71. var
  72.     aDoc:        AMReminderDoc;
  73. Begin
  74.     aDoc := NewAMReminderDoc;
  75.  
  76.     if aDoc <> nil then begin
  77.         {? add to list of docs}
  78.     end;
  79.  
  80.     MakeDoc := aDoc;
  81. End;
  82.  
  83. {----------}
  84. Procedure AMReminderApp.OpenApp;
  85. Begin
  86.     DoNew;
  87. End;
  88.  
  89. {----------}
  90. Function AMReminderApp.DoCommand (
  91.     inCommand:        longint): Boolean;
  92. begin
  93.     DoCommand := true;
  94.     case inCommand of
  95.         cmdAbout:
  96.                 DoAbout;
  97.         cmdNew:
  98.                 DoNew;
  99.         cmdOpen:
  100.                 DoOpen;
  101.         cmdClose:
  102.                 DoClose;
  103.         cmdQuit:
  104.                 DoQuit;
  105.  
  106.         otherwise
  107.                 DoCommand := false;
  108.     end; {case}
  109. end;
  110.  
  111. end.
  112.